Making Song Data


The following tells you how to make Song Data Files (.mid) and what to be aware of. 


INDEX Making Song Data
  (1)  File Names
  (2)  File Formats
  (3)  Data Conversion Precision
  (4)  Tempo when Creating Sound Effects
  (5)  Data Compression
  (6)  Tracks
  (7)  Loop Specification
  (8)  MIDI Events


(1) File Names

File names may be a maximum of 32 characters excluding extensions. 
The first character in a file name must be a letter of the alphabet. 
Absolutely no other characters than single-byte letters (A ~ Z, a ~ z); single-byte numerals (0 ~ 9) and the single-byte underline ( _ ) may be used. 
We recommend the extension ".mid," but other extensions may be used. 
Refer to "Song Files Names" in Song Setup concerning other extensions. 

Even though you may follow all these restrictions to the letter, it may happen that an error is generated by the random matching of a label internal to the system. If that happens, please change the name of the data file. 

Return to Top


(2) File Formats

Song data must be in Standard MIDI Format (Standard MIDI Files).
While there are currently three types of Standard MIDI Format, (format 0, 1 and 2), this system only accepts format 0 or format 1.
(If you can use either, we recommend using "format 1.")

Return to Top


(3) Data Conversion Precision

When considering game sounds in terms of hardware performance and ROM data efficiency, the precision of the sequencer is not exactly suited to the high precision demanded in recordings. For this reason, in this system, original song data will be converted with a quarter note resolution (Time Base) of 24. (With most PC sequencers, this would be from 48 ~ 960.)

In order to improve the data efficiency, there will be times when notes longer than a quarter note have their gate time truncated (a maximum of about a 32nd note). Normally, it is not enough to notice, but if it is a concern, you can change the settings in the Specifying Song Setup Options  so that they are not truncated. 

When actually making data, there is most likely no particular need to be concerned about these. Think of it as being a case where "any more details would be ignored." 
Return to Top


(4) Tempo when Creating Sound Effects 

In this system, the actual processing takes place using a standard of 1/60 of a second. For this reason, when making data that has very stringent timing, such as the use of rectangular wave sound effects, it is desirable to synchronize the time base clock to the processing standard time of 1/60 of a second. In order to do this, set the sequencer tempo to 150 (BPM). 

Return to Top


(5) Data Compression

In this system, in order to keep Object Files as small as possible, the following types of data compression are performed automatically. 

When the same MIDI event continues (i.e., continuous pitch bending).
When the same parameters continue (i.e., the velocity remains the same for a long time.)
When exactly the same measure is on the same track. (i.e., When measures are copied.)

So, if the following are kept in mind when making data, the compression rate will improve and the Object Files will become considerably smaller. 

Group MIDI Event or Note "Granules" as Much as Possible
Make data as uniform as possible by removing unnecessary or meaningless "changes" with "quantize," "timing adjust" or "dynamic adjust" features. 

When there are Structurally Identical Patterns in the Song, Use Copies of the Previous Pattern as Much as Possible
Even very slight differences will keep this system from judging two measures to be the same and it will not compress them. 

Return to Top


(6) Tracks

Each of the tracks in the song data will be converted starting with the lowest numbers up to a maximum of 16 tracks. However, if there is note data from different MIDI channels on the same track, it will consider the different MIDI channel to be a separate track and as many tracks as are necessary (starting with the lowest numbers) for the MIDI channels will be used. Note that the sound production priority of each track is higher, the lower the number.

Return to Top


(7) Loop Specification

When looping all tracks on a sequencer with the same timing, write single-byte brackets ( [ ] ) as markers on the sequencer. This will be converted so that the loop will start and finish at those positions. 

When you want to loop each track separately, you can set the MIDI control change number $Bx, 30, 100 to the start point, and $Bx, 30, 101 to the end point. If both this setting and loop setting with markers are used, the end point that comes first takes effect.

When making sounds for an engine, airplane or other similar sound effects that play continuously for long periods of time, be aware of the gate times and marker positions. For sounds having gate times of more than one measure, place a start point " [ "after the "note on" and an end point "] " before the "note off".

Return to Top


(8) MIDI Events 

The "MIDI Events" that can be played on this system are shown below. 
MIDI Events other than those listed will be ignored even if they are contained in the song data.

(Ref) Viewing MIDI Code


Content MIDI Code Internal .s Label
Measures and Beats        
Tempo   *3   TEMPO
Note On and Off  $9x(on) / $8x(off) Nxx (TIE)
Tone Color Selection   *4 $Cx VOICE
Volume  $Bx, 7 VOL
Panpot  $Bx, 10 PAN
Pitch Bend  $Ex BEND
Bend Range   *5 $Bx, 20   *1 BENDR
LFO(Modulation)Speed $Bx, 21   *1 LFOS
LFO(Modulation)delay $Bx, 26   *1 LFODL
Modulation Depth $Bx, 1 MOD
Modulation Type   *6 $Bx, 22   *1 MODT
Tuning $Bx, 24   *1 TUNE
Pseudo-echo Volume $Bx, 30, 8,  $Bx, 31, vv   *2 XCMD, xIECV
Pseudo-echo Length $Bx, 30, 9,  $Bx, 31, vv   *2 XCMD, xIECL
Priority   *7 $Bx, 33   *1 PRIO
Loop Start Point for each Track $Bx, 30, 100   *1  
Loop End Point for each Track $Bx, 30, 101   *1  
Data write to
Memory Access Area
$Bx, 14, aa, $Bx, 16, dd MEMACC, mem_set

*1 These control change numbers are not defined in standard MIDI and are used by this system alone. For this reason, depending upon the sequencer environment, it is possible these numbers could cause some entirely unrelated operations. 
That is, in environments like that, these specialized numbers may not be usable. 
One countermeasure is to add "30" to the control number and use that as the number for executing the function in question. 
(For Example: For Bend Range, it would be $Bx, 20 + 30 = 50 )  


(8) MIDI Events




*2 These commands are extension commands, so two continuous control changes ($Bx, 30 and $Bx, 31) must be specified to set them up. For example, when specifying the value "vv " for the pseudo echo volume, it would be "$Bx, 30, 8 " followed by "$Bx, 31, vv."
However, there are some sequencers that will sort this timing control change event (like the Performer)  in descending order, and you may find the order of 30 and 31 has been reversed. 
For such instances, we have made it possible to substitute 29 for 31
As in *1 above, 30 can be added to the numbers 29, 30 and 31 yielding 59, 60, and 61.  


(8) MIDI Events




*3 The possible range of Tempo settings is 2 ~ 510 (BPM).  


(8) MIDI Events




*4 The Tone Color Settings that can be chosen using the Tone Color Selection (Program Change) are in the mks4agb.ini File.  


(8) MIDI Events




*5 The Bend Range specifies the Maximum Pitch Bend Width and is expressed in half tones. 
Immediately after starting, the value is "2," that is, when the pitch bend is greatest, the pitch will be a whole tone higher (or lower).  


(8) MIDI Events




*6 The Modulation Types are selected from the following three types. 
   0 = Vibrato (Scale Change),
   1 = Tremolo (Volume Change),
   2 = Pan (Position Change) 
   Immediately after starting, the value is "0" (Scale Change).  


(8) MIDI Events




*7 This value is added to Song Priorities, making it the priority of the track in question.   As for the control change number, you can use 33, as well as 63 ( = 33 + 30 ) and 39 ( = old specifications ).


(8) MIDI Events


Return to Top


Next:[ Writing in the mks4agb.ini File ]
Back:[ Making Waveform Data ]
Top :[ Table of Contents ]